// mock测试

var apiMap = {
	GET: {
		"/getMessage":{"state":"200",'data':{"message":'helloworld'}},
	},
	POST: {
		"/getMessage1":{"state":"success",'data':{"message":'helloworld1'}},
	},
	DELETE:{},
	PUT:{}
};

function routeMap(){
	var str = {};
	Object.keys(apiMap).forEach(function(method){
		// var api = apiMap[method];
		Object.keys(apiMap[method]).forEach(function(url){
			var key = "" + method + " " + url;
			str[key] = function(req, res, next){
				res.send(apiMap[method][url]);
			}
		});
	});
	// console.log(str);
	return str;
}

module.exports = routeMap();